<?php

namespace PackageSpy;

use Nette\Object;
class PackageDomain extends Object{
	private $data;
	function __construct($data) {
		$this->data = $data;
	}
	
	public function searchPackageState(){
		$result = array();
		
		foreach($this->data->related('packagestate') as $packageState)
		{
			array_push($result, new PackageState($packageState)); 	
		} 
		return $result;
	}
	
	public function searchRole()
	{
		$result = array();
		foreach($this->data->related('role') as $role){
			array_push($result, new RoleDomain($role));			
		}
		return $result;
	}
	
	public function getPostingNumber()
	{	
		return '10'; 
	}

}
